{% extends 'myadmin/index.html' %}
{% block con %}
<div class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <form action="{% url 'cates_add' %}" method="POST" enctype="multipart/form-data"
                          class="am-form tpl-form-line-form">
                        {% csrf_token %}
                        <div class="card-header">
                            <div class="card-title">会员添加</div>
                        </div>

                        <div class="card-body">
                            <div class="form-group">

                                <label for="defaultSelect">所属分类</label>
                                <select name="pid" class="form-control form-control" id="defaultSelect">
                                    <option value="0">作为一级分类</option>
                                    {% for v in catelist%}
                                    <option value="{{v.id}}">{{v.sub}}{{v.name}}</option>
                                    {% endfor%}
                                </select>

                            </div>
                            <div class="form-group">
                                <label>分类名称</label>
                                <input type="text" class="form-control"  name="name"
                                       placeholder="请输入分类名称">
                            </div>

                            <div class="form-group">
                                <label >描述</label>
                                <textarea class="form-control" name="description" rows="5"></textarea>
                            </div>

                            <div class="form-group">
                                <label for="exampleFormControlFile1">缩略图</label>
                                <input type="file" class="form-control-file" name="thumbnail"
                                       id="exampleFormControlFile1">
                            </div>


                        </div>
                        <div class="card-action">
                            <button class="btn btn-success">添加</button>
                            <input class="btn btn-danger" type="submit" value="重置"/>
                        </div>
                </div>
                </form>
            </div>

        </div>
    </div>
</div>
</div>
{% endblock %}